/**
 * 购物车模型
 */
import Base from './base.js'
import Paging from '../static/js/paging.js'
class Order extends Base{
    constructor() {
    	super();
    }
	//提交订单页
	static async getSubmitOrder(data){
		return await Base.request({url:'index/get_submit_order',data:data})	 
	}
	//提交订单支付
	static async submitOrderPay(data){
		return await Base.request({
			url:'index/submit_order_pay',
			data:data,
			method:'POST'
		  }) 
	}
	//微信支付
	static async wxOrderPay(data){
		return await Base.request({
			url:'order/wx_order_pay',
			data:data,
			method:'POST'
		  }) 
	}
	/**
	 * 订单列表
	 */
	static getOrderList(data) {
		return new Paging({
			url:'order/get_order_list',
			data:data
		})
	}
	//商品详情
	static async getOrderDetail(data){
		return await Base.request({
			url:'order/get_order_detail',
			data:data
		 }) 
	}
	//取消订单
	static async orderCancel(data){
		return await Base.request({
			url:'order/order_cancel',
			data:data,
			method:'PUT'
		 }) 
	}
	// 确认收货
	static async orderConfirm(data){
		return await Base.request({
			url:'order/order_confirm',
			data:data,
			method:'PUT'
		 }) 
	}
	// 商品详情
	static async getOrderEvaluate(data){
		return await Base.request({
			url:'order/get_order_evaluate',
			data:data
		 }) 
	}
	// 商品评价
	static async orderEvaluate(data){
		return await Base.request({
			url:'order/order_evaluate',
			data:data,
			method:'POST'
		})
	}
	// 商品申诉
	static async orderComplain(data){
		return await Base.request({
			url:'order/order_complain',
			data:data,
			method:'POST'
		})
	}
}
export default Order